package com.orangelife.service.outexcell;

import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.Test;

public class CreateCellByFreemaker {
	@Test
	public void testoutPaymentSchedule() {
		List<String> titlelist = new ArrayList<String>();
		String excelCella = new String("序号");
		String excelCellb = new String("缴费月份");
		String excelCell1 = new String("物业管理费");

		String excelCellc = new String("合计（元）");
		titlelist.add(excelCella);
		titlelist.add(excelCellb);
		titlelist.add(excelCell1);

		titlelist.add(excelCellc);

		List<ExcelRow> Rowlist = new ArrayList<ExcelRow>();
		for (int i = 0; i < 100; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCell6 = new String("" + j);
			String excelCell7 = new String("2016.0" + j);

			String excelCell12 = new String("40");
			String excelCell13 = new String("200");
			celllist.add(excelCell6);
			celllist.add(excelCell7);

			celllist.add(excelCell12);
			celllist.add(excelCell13);
			ExcelRow excelRow = new ExcelRow(celllist);
			Rowlist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("120");

		String excelCell19 = new String("600");

		Totallist.add(excelCell14);

		Totallist.add(excelCell19);
		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";

		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);

		outPaymentSchedule(titlelist, Rowlist, Totallist, CommunityName,
				StatisticsTime, Statistics, nametime + "_ScheduleOfFees.xls",
				null, "1000", "100");

	}

	@Test
	public void testoutPaymentScheduleByMonth() {
		List<String> titlelist = new ArrayList<String>();
		String excelCell1 = new String("序号");
		String excelCell20 = new String("缴费时间");
		String excelCell2 = new String("是否开票");
		String excelCell3 = new String("发票单号");
		String excelCell4 = new String("产权类型");
		String excelCell5 = new String("户号");
		String excelCell6 = new String("业主姓名");
		String excelCell7 = new String("支付方式");
		String excelCell8 = new String("物业管理费");
		String excelCell9 = new String("公共维修金");
		String excelCell10 = new String("车位管理费");
		String excelCell11 = new String("车位维修金");
		String excelCell12 = new String("公摊水电费");
		String excelCell13 = new String("合计（元）");
		titlelist.add(excelCell1);
		titlelist.add(excelCell20);
		titlelist.add(excelCell2);
		titlelist.add(excelCell3);
		titlelist.add(excelCell4);
		titlelist.add(excelCell5);
		titlelist.add(excelCell6);
		titlelist.add(excelCell7);
		titlelist.add(excelCell8);
		titlelist.add(excelCell9);
		titlelist.add(excelCell10);
		titlelist.add(excelCell11);
		titlelist.add(excelCell12);
		titlelist.add(excelCell13);

		List<ExcelRow> Rowlist = new ArrayList<ExcelRow>();
		for (int i = 0; i < 100; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCella = new String("" + j);
			String excelCellb = new String("2016.0" + j);

			String excelCellc = new String("40");
			String excelCelld = new String("200");
			celllist.add(excelCella);
			celllist.add(excelCellb);

			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);

			celllist.add(excelCelld);
			ExcelRow excelRow = new ExcelRow(celllist);
			Rowlist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("1200");

		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);

		Totallist.add(excelCell19);
		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";

		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);

		outPaymentScheduleByMonth(titlelist, Rowlist, Totallist, CommunityName,
				StatisticsTime, Statistics, nametime
						+ "_ScheduleOfFeesByMonth.xls", null, "1000", "100");

	}

	@Test
	public void testoutBillingSchedule() {
		List<String> titlelist = new ArrayList<String>();
		String excelCell1 = new String("序号");
		String excelCell20 = new String("开单时间");
		String excelCell3 = new String("发票单号");
		String excelCell4 = new String("产权类型");
		String excelCell5 = new String("户号");
		String excelCell6 = new String("业主姓名");
		String excelCell8 = new String("物业管理费");
		String excelCell9 = new String("公共维修金");
		String excelCell10 = new String("车位管理费");
		String excelCell11 = new String("车位维修金");
		String excelCell12 = new String("公摊水电费");
		String excelCell13 = new String("合计（元）");
		titlelist.add(excelCell1);
		titlelist.add(excelCell20);

		titlelist.add(excelCell3);
		titlelist.add(excelCell4);
		titlelist.add(excelCell5);
		titlelist.add(excelCell6);
		titlelist.add(excelCell8);
		titlelist.add(excelCell9);
		titlelist.add(excelCell10);
		titlelist.add(excelCell11);
		titlelist.add(excelCell12);
		titlelist.add(excelCell13);

		List<ExcelRow> Rowlist = new ArrayList<ExcelRow>();
		for (int i = 0; i < 100; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCella = new String("" + j);
			String excelCellb = new String("2016.0" + j);

			String excelCellc = new String("40");
			String excelCelld = new String("200");
			celllist.add(excelCella);
			celllist.add(excelCellb);

			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);

			celllist.add(excelCelld);
			ExcelRow excelRow = new ExcelRow(celllist);
			Rowlist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("1200");

		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell19);

		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";

		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);

		outBillingSchedule(titlelist, Rowlist, Totallist, CommunityName,
				StatisticsTime, Statistics, nametime + "_BillingSchedule.xls",
				null, "1000", "100");

	}

	@Test
	public void testoutStatisticsOfArrears() {
		List<String> titlelist = new ArrayList<String>();
		String excelCell1 = new String("序号");

		String excelCell4 = new String("产权类型");
		String excelCell5 = new String("户号");
		String excelCell6 = new String("业主姓名");
		String excelCell10 = new String("计费面积");
		String excelCell8 = new String("物业管理费");
		String excelCell9 = new String("公共维修金");

		String excelCell13 = new String("合计（元）");
		titlelist.add(excelCell1);
		titlelist.add(excelCell4);
		titlelist.add(excelCell5);
		titlelist.add(excelCell6);
		titlelist.add(excelCell8);
		titlelist.add(excelCell9);
		titlelist.add(excelCell10);

		titlelist.add(excelCell13);

		List<ExcelRow> Rowlist = new ArrayList<ExcelRow>();
		for (int i = 0; i < 100; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCella = new String("" + j);
			String excelCellb = new String("2016.0" + j);

			String excelCellc = new String("40");
			String excelCelld = new String("200");
			celllist.add(excelCella);
			celllist.add(excelCellb);

			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);

			celllist.add(excelCelld);
			ExcelRow excelRow = new ExcelRow(celllist);
			Rowlist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("1200");

		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell19);

		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";

		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);

		outStatisticsOfArrears(titlelist, Rowlist, Totallist, CommunityName,
				StatisticsTime, Statistics, nametime
						+ "_StatisticsOfArrears.xls", null, "1000", "100");

	}

	@Test
	public void testoutStatisticsOfArrearsBySplitDetailMonth() {

		List<String> bigtitlelist = new ArrayList<String>();
		List<String> secondtitlelist = new ArrayList<String>();
		String excelCell1 = new String("序号");

		String excelCell4 = new String("产权类型");
		String excelCell5 = new String("户号");
		String excelCell6 = new String("业主姓名");
		String excelCell10 = new String("计费面积");

		bigtitlelist.add(excelCell1);
		bigtitlelist.add(excelCell4);
		bigtitlelist.add(excelCell5);
		bigtitlelist.add(excelCell6);
		bigtitlelist.add(excelCell10);

		String excelCell8 = new String("物业管理费");
		String excelCell9 = new String("公共维修金");
		String e1 = new String("车位管理费");
		String e2 = new String("车位维修金");
		String e3 = new String("公摊水电费");

		for (int i = 0; i < 3; i++) {

			secondtitlelist.add(excelCell8);
			secondtitlelist.add(excelCell9);
			secondtitlelist.add(e1);
			secondtitlelist.add(e2);
			secondtitlelist.add(e3);
		}

		String excelCell13 = new String("合计（元）");
		secondtitlelist.add(excelCell13);

		List<String> monthtitlelist = new ArrayList<String>();

		monthtitlelist.add(new String("2016.01"));
		monthtitlelist.add(new String("2016.02"));
		monthtitlelist.add(new String("2016.03"));

		List<ExcelRow> Rowlist = new ArrayList<ExcelRow>();
		for (int i = 0; i < 600; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCella = new String("" + j);
			String excelCellb = new String("2016.0" + j);

			String excelCellc = new String("40");
			String excelCelld = new String("200");
			celllist.add(excelCella);
			celllist.add(excelCellb);

			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);

			celllist.add(excelCelld);
			ExcelRow excelRow = new ExcelRow(celllist);
			Rowlist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("3600");

		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell19);

		List<String> bigTotallist = new ArrayList<String>();
		bigTotallist.add(new String("1200"));
		bigTotallist.add(new String("1200"));
		bigTotallist.add(new String("1200"));

		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";
		String total = new String("3600");

		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);

		outStatisticsOfArrearsByDetailSplitMonth(bigtitlelist, monthtitlelist,
				secondtitlelist, Rowlist, bigTotallist, Totallist, total,
				CommunityName, StatisticsTime, Statistics, "4", "4", nametime
						+ "_StatisticsOfArrearsBySplitDetailMonth.xls", null,
				"1000", "100");

	}

	@Test
	public void testoutStatisticsOfArrearsByDetailMonth() {
		List<String> titlelist = new ArrayList<String>();
		String excelCell1 = new String("序号");

		String excelCell4 = new String("产权类型");
		String excelCell5 = new String("户号");
		String excelCell6 = new String("业主姓名");
		String excelCell10 = new String("计费面积");
		String excelCell8 = new String("物业管理费");
		String excelCell9 = new String("公共维修金");
		String e1 = new String("车位管理费");
		String e2 = new String("车位维修金");
		String e3 = new String("公摊水电费");

		String excelCell13 = new String("合计（元）");
		titlelist.add(excelCell1);
		titlelist.add(excelCell4);
		titlelist.add(excelCell5);
		titlelist.add(excelCell6);
		titlelist.add(excelCell10);
		titlelist.add(excelCell8);
		titlelist.add(excelCell9);
		titlelist.add(e1);
		titlelist.add(e2);
		titlelist.add(e3);

		titlelist.add(excelCell13);

		List<ExcelRow> Rowlist = new ArrayList<ExcelRow>();
		for (int i = 0; i < 100; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCella = new String("" + j);
			String excelCellb = new String("2016.0" + j);

			String excelCellc = new String("40");
			String excelCelld = new String("200");
			celllist.add(excelCella);
			celllist.add(excelCellb);

			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);

			celllist.add(excelCelld);
			ExcelRow excelRow = new ExcelRow(celllist);
			Rowlist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("1200");

		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell19);

		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";

		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);

		outStatisticsOfArrearsByDetailMonth(titlelist, Rowlist, Totallist,
				CommunityName, StatisticsTime, Statistics, nametime
						+ "_StatisticsOfArrearsByDetailMonth.xls", null,
				"1000", "100");

	}

	@Test
	public void testoutStatisticsOfArrearsByMultipleDistric() {
		List<String> titlelist = new ArrayList<String>();
		String excelCell1 = new String("序号");

		String excelCell4 = new String("小区名称");

		String excelCell8 = new String("物业管理费");
		String excelCell9 = new String("公共维修金");
		String e1 = new String("车位管理费");
		String e2 = new String("车位维修金");
		String e3 = new String("公摊水电费");

		String excelCell13 = new String("合计（元）");
		titlelist.add(excelCell1);
		titlelist.add(excelCell4);
		// titlelist.add(excelCell5);
		// titlelist.add(excelCell6);
		// titlelist.add(excelCell10);
		titlelist.add(excelCell8);
		titlelist.add(excelCell9);
		titlelist.add(e1);
		titlelist.add(e2);
		titlelist.add(e3);

		titlelist.add(excelCell13);

		List<ExcelRow> Rowlist = new ArrayList<ExcelRow>();
		for (int i = 0; i < 100; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCella = new String("" + j);
			String excelCellb = new String("2016.0" + j);

			String excelCellc = new String("40");
			String excelCelld = new String("200");
			celllist.add(excelCella);
			celllist.add(excelCellb);

			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);

			celllist.add(excelCelld);
			ExcelRow excelRow = new ExcelRow(celllist);
			Rowlist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("1200");

		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell19);

		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";

		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);

		outStatisticsOfArrearsByMultipleDistric(titlelist, Rowlist, Totallist,
				CommunityName, StatisticsTime, Statistics, nametime
						+ "StatisticsOfArrearsByMultipleDistric.xls", null,
				"1000", "100");

	}

	@Test
	public void testoutRateTablesBySingleCell() {
		List<String> titlelist = new ArrayList<String>();
		String excelCell1 = new String("序号");

		String excelCell4 = new String("收费类目");

		String excelCell8 = new String("应收金额（元）");
		String excelCell9 = new String("已收金额（元）");
		String e1 = new String("未收金额（元）");
		String e2 = new String("收费率");

		titlelist.add(excelCell1);
		titlelist.add(excelCell4);
		// titlelist.add(excelCell5);
		// titlelist.add(excelCell6);
		// titlelist.add(excelCell10);
		titlelist.add(excelCell8);
		titlelist.add(excelCell9);
		titlelist.add(e1);
		titlelist.add(e2);

		List<ExcelRow> Rowlist = new ArrayList<ExcelRow>();
		for (int i = 0; i < 100; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCella = new String("" + j);
			String excelCellb = new String("2016.0" + j);

			String excelCellc = new String("40");
			String excelCelld = new String("200");
			celllist.add(excelCella);
			celllist.add(excelCellb);

			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);

			celllist.add(excelCelld);
			ExcelRow excelRow = new ExcelRow(celllist);
			Rowlist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("1200");

		// Totallist.add(excelCell14);
		// Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell19);

		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";
		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);
		outRateTablesBySingleCell(titlelist, Rowlist, Totallist, CommunityName,
				StatisticsTime, Statistics, nametime
						+ "_RateTablesBySingleCell.xls", null, "1000", "100");

	}

	@Test
	public void testoutRateTablesBySingleCellAndCategory() {
		List<String> titlelist = new ArrayList<String>();
		String excelCell1 = new String("收费类目");

		String excelCell4 = new String("月份");

		String excelCell8 = new String("应收金额（元）");
		String excelCell9 = new String("已收金额（元）");
		String e1 = new String("未收金额（元）");
		String e2 = new String("收费率");

		titlelist.add(excelCell1);
		titlelist.add(excelCell4);
		// titlelist.add(excelCell5);
		// titlelist.add(excelCell6);
		// titlelist.add(excelCell10);
		titlelist.add(excelCell8);
		titlelist.add(excelCell9);
		titlelist.add(e1);
		titlelist.add(e2);

		List<ExcelRowForRateTablesByCategory> valuelist = new ArrayList<ExcelRowForRateTablesByCategory>();

		for (int i = 0; i < 600; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCellb = new String("2016.0" + j);

			String excelCellc = new String("40");
			String excelCelld = new String("200");

			celllist.add(excelCellb);

			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);

			celllist.add(excelCelld);
			ExcelRowForRateTablesByCategory excelRow = new ExcelRowForRateTablesByCategory();
			if (j % 3 == 1) {
				excelRow = new ExcelRowForRateTablesByCategory("收费类目" + j,
						celllist);

			} else {
				excelRow = new ExcelRowForRateTablesByCategory(null, celllist);
			}
			valuelist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("1200");

		// Totallist.add(excelCell14);
		// Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell19);

		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";
		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);
		outRateTablesBySingleCellAndCategory(titlelist, valuelist, Totallist,
				CommunityName, StatisticsTime, Statistics, nametime
						+ "_RateTablesBySingleCellAndCategory.xls", null,
				"1000", "100",3);

	}

	@Test
	public void testoutRateTablesBySingleCellAndMonth() {
		List<String> titlelist = new ArrayList<String>();
		String excelCell1 = new String("月份");

		String excelCell4 = new String("收费类目");

		String excelCell8 = new String("应收金额（元）");
		String excelCell9 = new String("已收金额（元）");
		String e1 = new String("未收金额（元）");
		String e2 = new String("收费率");
		String e3 = new String("合计（元）");
		String e4 = new String("合计收费率");
		titlelist.add(excelCell1);
		titlelist.add(excelCell4);
		// titlelist.add(excelCell5);
		// titlelist.add(excelCell6);
		// titlelist.add(excelCell10);
		titlelist.add(excelCell8);
		titlelist.add(excelCell9);
		titlelist.add(e1);
		titlelist.add(e2);
		titlelist.add(e3);
		titlelist.add(e4);

		List<ExcelRowForRateTablesByMonth> valuelist = new ArrayList<ExcelRowForRateTablesByMonth>();

		for (int i = 0; i < 1500; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;

			String excelCelld = new String("物业管理费");
			String excelCellc = new String("40");

			celllist.add(excelCelld);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);

			ExcelRowForRateTablesByMonth excelRow = new ExcelRowForRateTablesByMonth();
			if (j % 5 == 1) {

				excelRow.setMonth("2016.0" + j);
				excelRow.setExcelCells(celllist);
				excelRow.setTotal("200");
				excelRow.setTotalrate("20%");

			} else {
				excelRow.setExcelCells(celllist);
			}
			valuelist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("1200");

		// Totallist.add(excelCell14);
		// Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell19);
		Totallist.add(excelCell19);

		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";
		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);
		outRateTablesBySingleCellAndMonth(titlelist, valuelist, Totallist,
				CommunityName, StatisticsTime, Statistics, nametime
						+ "_RateTablesBySingleCellAndMonth.xls", null, "2000","100",5);

	}

	@Test
	public void testoutRateTablesByMultipleCell() {
		List<String> titlelist = new ArrayList<String>();
		String excelCell1 = new String("小区名称");

		String excelCell8 = new String("应收金额（元）");
		String excelCell9 = new String("已收金额（元）");
		String e1 = new String("未收金额（元）");
		String e2 = new String("收费率");

		titlelist.add(excelCell1);
		// titlelist.add(excelCell4);
		// titlelist.add(excelCell5);
		// titlelist.add(excelCell6);
		// titlelist.add(excelCell10);
		titlelist.add(excelCell8);
		titlelist.add(excelCell9);
		titlelist.add(e1);
		titlelist.add(e2);

		List<ExcelRow> Rowlist = new ArrayList<ExcelRow>();
		for (int i = 0; i < 100; i++) {
			List<String> celllist = new ArrayList<String>();
			int j = i + 1;
			String excelCella = new String("" + j);
			String excelCellb = new String("2016.0" + j);

			String excelCellc = new String("40");
			String excelCelld = new String("200");
			celllist.add(excelCella);
			celllist.add(excelCellb);

			// celllist.add(excelCellc);
			celllist.add(excelCellc);
			celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);
			// celllist.add(excelCellc);

			celllist.add(excelCelld);
			ExcelRow excelRow = new ExcelRow(celllist);
			Rowlist.add(excelRow);
		}

		List<String> Totallist = new ArrayList<String>();
		String excelCell14 = new String("240");

		String excelCell19 = new String("1200");

		// Totallist.add(excelCell14);
		// Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell14);
		Totallist.add(excelCell19);

		String CommunityName = "源昌大厦";
		String StatisticsTime = "2016.01.01-2016.3.31";
		String Statistics = "饶辉";
		Date date2 = new Date();
		SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyyMMddHHmmss");
		String nametime = dateFormat2.format(date2);
		outRateTablesByMultipleCell(titlelist, Rowlist, Totallist,
				CommunityName, StatisticsTime, Statistics, nametime
						+ "_RateTablesByMultipleCell.xls", null, "1000", "100");

	}

	/**
	 * 功能:缴费明细表
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称,传了文件输出流后可以不用传)
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数)
	 * 
	 *            注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outPaymentSchedule(List<String> titlelist,
			List<ExcelRow> valuelist, List<String> Totallist,
			String CommunityName, String StatisticsTime, String Statistics,
			String filename, FileOutputStream fileOutputStream,
			String RowCount, String ColumnCount) {

		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("Rowlist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();
		freemakerModel.create(data, "excel/" + filename, "ScheduleOfFees.ftl",
				fileOutputStream);

	}

	/**
	 * 功能:缴费明细表（月度明细）
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称,传了文件输出流后可以不用传)
	 * 
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数)
	 * 
	 *            注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outPaymentScheduleByMonth(List<String> titlelist,
			List<ExcelRow> valuelist, List<String> Totallist,
			String CommunityName, String StatisticsTime, String Statistics,
			String filename, FileOutputStream fileOutputStream,
			String RowCount, String ColumnCount) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("Rowlist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);

		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();

		freemakerModel.create(data, "excel/" + filename,
				"ScheduleOfFeesByMonth.ftl", fileOutputStream);
	}

	/**
	 * 功能:开单明细表
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称,传了文件输出流后可以不用传)
	 * 
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数)
	 * 
	 *            注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outBillingSchedule(List<String> titlelist,
			List<ExcelRow> valuelist, List<String> Totallist,
			String CommunityName, String StatisticsTime, String Statistics,
			String filename, FileOutputStream fileOutputStream,
			String RowCount, String ColumnCount) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("Rowlist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();

		freemakerModel.create(data, "excel/" + filename, "BillingSchedule.ftl",
				fileOutputStream);
	}

	/**
	 * 功能:欠费统计表（单小区明细-按筛选条件导出）
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称,传了文件输出流后可以不用传)
	 * 
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数) 注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outStatisticsOfArrears(List<String> titlelist,
			List<ExcelRow> valuelist, List<String> Totallist,
			String CommunityName, String StatisticsTime, String Statistics,
			String filename, FileOutputStream fileOutputStream,
			String RowCount, String ColumnCount) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("Rowlist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();

		freemakerModel.create(data, "excel/" + filename,
				"StatisticsOfArrears.ftl", fileOutputStream);
	}

	/**
	 * 功能:欠费统计表（单小区明细-拆分月份显示）
	 * 
	 * @param bigtitlelist
	 *            (一级标题的集合)
	 * @param monthtitlelist
	 *            (月份标题的集合)
	 * @param secondtitlelist
	 *            (二级标题的集合)
	 * @param valuelist
	 *            (值的集合)
	 * @param BigTotallist
	 *            (总计的总计的集合)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param monthCellSize
	 *            (月份标题占的格子数)
	 * @param bigtitlesize
	 *            (一级标题占得格子数)
	 * @param filename
	 *            (生成的文件名称)
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数) 注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outStatisticsOfArrearsByDetailSplitMonth(
			List<String> bigtitlelist, List<String> monthtitlelist,
			List<String> secondtitlelist, List<ExcelRow> valuelist,
			List<String> BigTotallist, List<String> Totallist, String total,
			String CommunityName, String StatisticsTime, String Statistics,
			String monthCellSize, String bigtitlesize, String filename,
			FileOutputStream fileOutputStream, String RowCount,
			String ColumnCount) {
		Map<String, Object> data = new HashMap<String, Object>();

		data.put("bigtitlelist", bigtitlelist);
		data.put("monthtitlelist", monthtitlelist);
		data.put("secondtitlelist", secondtitlelist);
		data.put("Rowlist", valuelist);
		data.put("BigTotallist", BigTotallist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("monthCellSize", monthCellSize);
		data.put("bigtitlesize", bigtitlesize);
		data.put("total", total);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();
		freemakerModel.create(data, "excel/" + filename,
				"StatisticsOfArrearsBySplitDetailMonth.ftl", fileOutputStream);
	}

	/**
	 * 功能:欠费统计表（单小区明细-合并月份总计）
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称)
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数) 注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outStatisticsOfArrearsByDetailMonth(List<String> titlelist,
			List<ExcelRow> valuelist, List<String> Totallist,
			String CommunityName, String StatisticsTime, String Statistics,
			String filename, FileOutputStream fileOutputStream,
			String RowCount, String ColumnCount) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("Rowlist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();
		freemakerModel.create(data, "excel/" + filename,
				"StatisticsOfArrearsByDetailMonth.ftl", fileOutputStream);
	}

	/**
	 * 功能:欠费统计表（多个小区总计）
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称)
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数) 注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outStatisticsOfArrearsByMultipleDistric(List<String> titlelist,
			List<ExcelRow> valuelist, List<String> Totallist,
			String CommunityName, String StatisticsTime, String Statistics,
			String filename, FileOutputStream fileOutputStream,
			String RowCount, String ColumnCount) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("Rowlist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();

		freemakerModel.create(data, "excel/" + filename,
				"StatisticsOfArrearsByMultipleDistric.ftl", fileOutputStream);
	}

	/**
	 * 功能:收费率统计表（单小区）
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称)
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数) 注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outRateTablesBySingleCell(List<String> titlelist,
			List<ExcelRow> valuelist, List<String> Totallist,
			String CommunityName, String StatisticsTime, String Statistics,
			String fileName, FileOutputStream fileOutputStream,
			String RowCount, String ColumnCount) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("Rowlist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();

		freemakerModel.create(data, "excel/" + fileName,
				"RateTablesBySingleCell.ftl", fileOutputStream);
	}

	/**
	 * 功能:收费率统计表（多小区）
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称)
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数) 注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outRateTablesByMultipleCell(List<String> titlelist,
			List<ExcelRow> valuelist, List<String> Totallist,
			String CommunityName, String StatisticsTime, String Statistics,
			String fileName, FileOutputStream fileOutputStream,
			String RowCount, String ColumnCount) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("Rowlist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();

		freemakerModel.create(data, "excel/" + fileName,
				"RateTablesByMultipleCell.ftl", fileOutputStream);
	}

	/**
	 * 功能:收费率统计表（单小区-按类目划分）
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合，收费类目这个项目中的值需要用ExcelRowForRateTablesByCategory包装)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称)
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数) 注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * */
	public void outRateTablesBySingleCellAndCategory(List<String> titlelist,
			List<ExcelRowForRateTablesByCategory> valuelist,
			List<String> Totallist, String CommunityName,
			String StatisticsTime, String Statistics, String fileName,
			FileOutputStream fileOutputStream, String RowCount,
			String ColumnCount,Integer itemCount) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("valuelist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		data.put("itemCount",itemCount-1);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();

		freemakerModel.create(data, "excel/" + fileName,
				"RateTablesBySingleCellAndCategory.ftl", fileOutputStream);
	}

	/**
	 * 功能:收费率统计表（单小区-按月份划分）
	 * 
	 * @param titlelist
	 *            (标题的集合)
	 * @param valuelist
	 *            (值的集合，月份，合计（元），合计收费率需要用ExcelRowForRateTablesByMonth包装)
	 * @param Totallist
	 *            (总计的集合)
	 * @param CommunityName
	 *            (小区名称)
	 * @param StatisticsTime
	 *            (统计时间)
	 * @param Statistics
	 *            (统计人)
	 * @param filename
	 *            (生成的文件名称)
	 * @param fileOutputStream
	 *            (文件输出流)
	 * @param RowCount
	 *            (行数)
	 * @param ColumnCount
	 *            (列数) 
	 * @param itemCount(收费类目项目数)
	 *            注意:标题的集合，值的集合，总计的集合的关系需要一一对应
	 * 
	 * 
	 * */
	public void outRateTablesBySingleCellAndMonth(List<String> titlelist,
			List<ExcelRowForRateTablesByMonth> valuelist,
			List<String> Totallist, String CommunityName,
			String StatisticsTime, String Statistics, String fileName,
			FileOutputStream fileOutputStream, String RowCount,
			String ColumnCount, Integer itemCount) {
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("titlelist", titlelist);
		data.put("valuelist", valuelist);
		data.put("Totallist", Totallist);
		data.put("CommunityName", CommunityName);
		data.put("StatisticsTime", StatisticsTime);
		data.put("Statistics", Statistics);
		data.put("RowCount", RowCount);
		data.put("ColumnCount", ColumnCount);
		data.put("itemCount", itemCount-1);
		Date date1 = new Date();
		SimpleDateFormat dateFormat1 = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm:ss");
		String createtime = dateFormat1.format(date1);
		System.out.println(createtime);
		data.put("createtime", createtime);

		FreemakerModel freemakerModel = new FreemakerModel();

		freemakerModel.create(data, "excel/" + fileName,
				"RateTablesBySingleCellAndMonth.ftl", fileOutputStream);
	}

}
